<template>
  <div>
    <div class="footer">
      <ul>
        <router-link to="/" tag="li">
          <span class="iconfont icon-shouye"></span>
          <p>首页</p>
        </router-link>
        <router-link to="/kind" tag="li">
          <span class="iconfont icon-kinds"></span>
          <p>分类</p>
        </router-link>
        <router-link to="/cant" tag="li">
          <span class="iconfont icon-cart"></span>
          <p>购物车</p>
        </router-link>
        <router-link to="/my" tag="li" v-if="isShowIcon">
          <span class="iconfont icon-my"></span>
          <p>我的</p>
        </router-link>
        <router-link to="/my" tag="li" v-else>
          <span class="iconfont icon-my"></span>
          <p>未登录</p>
        </router-link>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  computed: {
    isShowIcon() {
      if (localStorage.getItem("token")) {
        return true;
      } else {
        return false;
      }
    },
  },
};
</script>

<style>
</style>